package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.SwapFaceBatchMapper;
import com.ruoyi.system.domain.SwapFaceBatch;
import com.ruoyi.system.service.ISwapFaceBatchService;
import com.ruoyi.common.core.text.Convert;

/**
 * 批次换脸Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-09-25
 */
@Service
public class SwapFaceBatchServiceImpl implements ISwapFaceBatchService 
{
    @Autowired
    private SwapFaceBatchMapper swapFaceBatchMapper;

    /**
     * 查询批次换脸
     * 
     * @param batchId 批次换脸主键
     * @return 批次换脸
     */
    @Override
    public SwapFaceBatch selectSwapFaceBatchByBatchId(Long batchId)
    {
        return swapFaceBatchMapper.selectSwapFaceBatchByBatchId(batchId);
    }

    /**
     * 查询批次换脸列表
     * 
     * @param swapFaceBatch 批次换脸
     * @return 批次换脸
     */
    @Override
    public List<SwapFaceBatch> selectSwapFaceBatchList(SwapFaceBatch swapFaceBatch)
    {
        return swapFaceBatchMapper.selectSwapFaceBatchList(swapFaceBatch);
    }

    /**
     * 新增批次换脸
     * 
     * @param swapFaceBatch 批次换脸
     * @return 结果
     */
    @Override
    public int insertSwapFaceBatch(SwapFaceBatch swapFaceBatch)
    {
        swapFaceBatch.setCreateTime(DateUtils.getNowDate());
        return swapFaceBatchMapper.insertSwapFaceBatch(swapFaceBatch);
    }

    /**
     * 修改批次换脸
     * 
     * @param swapFaceBatch 批次换脸
     * @return 结果
     */
    @Override
    public int updateSwapFaceBatch(SwapFaceBatch swapFaceBatch)
    {
        swapFaceBatch.setUpdateTime(DateUtils.getNowDate());
        return swapFaceBatchMapper.updateSwapFaceBatch(swapFaceBatch);
    }

    /**
     * 批量删除批次换脸
     * 
     * @param batchIds 需要删除的批次换脸主键
     * @return 结果
     */
    @Override
    public int deleteSwapFaceBatchByBatchIds(String batchIds)
    {
        return swapFaceBatchMapper.deleteSwapFaceBatchByBatchIds(Convert.toStrArray(batchIds));
    }

    /**
     * 删除批次换脸信息
     * 
     * @param batchId 批次换脸主键
     * @return 结果
     */
    @Override
    public int deleteSwapFaceBatchByBatchId(Long batchId)
    {
        return swapFaceBatchMapper.deleteSwapFaceBatchByBatchId(batchId);
    }
}
